package com.example.mybatisplus.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.mybatisplus.model.domain.Userlist;
import com.example.mybatisplus.mapper.UserlistMapper;
import com.example.mybatisplus.service.UserlistService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author lxp
 * @since 2022-12-26
 */
@Service
public class UserlistServiceImpl extends ServiceImpl<UserlistMapper, Userlist> implements UserlistService {

    @Autowired
    private UserlistMapper userlistMapper;
    @Override
    public Userlist login(Userlist userlist) {
        QueryWrapper<Userlist> userlistQueryWrapper = new QueryWrapper<>();
        userlistQueryWrapper.eq("username", userlist.getUsername()).eq("password", userlist.getPassword());
        Userlist userlist1 = userlistMapper.selectOne(userlistQueryWrapper);
        return userlist1;
    }

}
